﻿using System;
using UnityEngine;

namespace OestsCommon.Player
{
    /// <summary>
    /// JSON 不支持 float类型传输
    /// 自定义Point3 位置坐标类，代替unity中的Vector3再Json中传输
    /// </summary>
    public class Point3
    {
        public Double x;
        public Double y;
        public Double z;

        public Point3()
        {

        }

        public Point3(Vector3 v3)
        {
            x = (Double)v3.x;
            y = (Double)v3.y;
            z = (Double)v3.z;
        }

        public Vector3 ToVector3()
        {
            Vector3 v3 = new Vector3((float)x, (float)y, (float)z);
            return v3;
        }
    }
}
